'use strict';

new Vue({
  el: '#root',

  data: {
    years: [],
    months: [],
    days: []
  },

  created: function created() {
    this.years = this.getBornYears();
    this.months = this.getBornMonths();
    this.days = this.getBornDays();
  },


  methods: {
    getBornYears: function getBornYears() {
      var currentYear = new Date().getFullYear();
      var years = [];
      for (var i = currentYear; i >= 1900; i--) {
        years.push(i);
      }
      return years;
    },
    getBornMonths: function getBornMonths() {
      var months = [];
      for (var i = 1; i <= 12; i++) {
        months.push(i);
      }
      return months;
    },
    getBornDays: function getBornDays() {
      var days = [];
      for (var i = 1; i <= 31; i++) {
        days.push(i);
      }
      return days;
    },
    onTapBack: function onTapBack() {
      history.go(-1);
    },
    onTapSearch: function onTapSearch() {
      window.open('./luck-result.html');
    }
  }
});